/*Replication files BJPS Balcells Dorsey Tellez 2020
Survey Analyses
*/

**********

*use "victimization.dta"

**********************************************************
***********************************************************
//regressions for people who VOTED in the 1-0 referendum
***********************************************************
***********************************************************

//DV: they would vote YES in a potential legal/agreed referendum
set more off
logit voteYES_agreedref gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim if votedref==1, rob
est store M1
logit voteYES_agreedref gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim_close if votedref==1, rob
est store M2
esttab M1 M2 using Table1.tex, b(a2) se(a2) scalars(ll) star(+ 0.10 * 0.05 ** 0.01) nogaps replace


//DV: participation in protests
logit partprotest gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim if votedref==1, rob
est store M1
logit partprotest gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim_close if votedref==1, rob
est store M2
esttab M1 M2 using Table2.tex, b(a2) se(a2) scalars(ll) star(+ 0.10 * 0.05 ** 0.01) nogaps replace


**********************************************************
***********************************************************
//regressions for people who VOTED and voted YES in the 1-0 referendum
***********************************************************
***********************************************************

**********
//DV: they would vote YES in a potential legal/agreed referendum
set more off
logit voteYES_agreedref gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim if votedyes==1, rob
est store M1
logit voteYES_agreedref gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim_close if votedyes==1, rob
est store M2
esttab M1 M2 using Table3.tex, b(a2) se(a2) scalars(ll) star(+ 0.10 * 0.05 ** 0.01) nogaps replace


//DV: participation in protests
logit partprotest gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim if votedyes==1, rob
est store M1
logit partprotest gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim_close if votedyes==1, rob
est store M2
esttab M1 M2 using Table4.tex, b(a2) se(a2) scalars(ll) star(+ 0.10 * 0.05 ** 0.01) nogaps replace


**********************************************************
***********************************************************
//regressions for people who WOULD HAVE VOTED in the 1-0 referendum: 
//this includes people who voted AND people who did not vote because of logistics 
//or because the police impeded them to vote (thus, who were willing to vote but they could not)
***********************************************************
***********************************************************
/*gen wvotedref = votedref
replace wvotedref = 1 if reasons_novote == 4 
replace wvotedref = 1 if reasons_novote == 5
replace votedyes =. if votedref==.
*/

**********
//DV: they would vote YES in a potential legal/agreed referendum
set more off
logit voteYES_agreedref gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim if wvotedref==1, rob
est store M1
logit voteYES_agreedref gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim_close if wvotedref==1, rob
est store M2
esttab M1 M2 using Table5.tex, b(a2) se(a2) scalars(ll) star(+ 0.10 * 0.05 ** 0.01) nogaps replace

//DV: participation in protests
logit partprotest gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim if wvotedref==1, rob
est store M1
logit partprotest gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim_close if wvotedref==1, rob
est store M2
esttab M1 M2 using Table6.tex, b(a2) se(a2) scalars(ll) star(+ 0.10 * 0.05 ** 0.01) nogaps replace


********************************************************
********************************************************
//regressions for people who did NOT VOTE in the 1-0 referendum 
********************************************************

//DV: they would vote YES in a potential legal/agreed referendum
set more off
logit voteYES_agreedref gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim if votedref==0, rob
est store M1
logit voteYES_agreedref gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim_close if votedref==0, rob
est store M2
esttab M1 M2 using Table7.tex, b(a2) se(a2) scalars(ll) star(+ 0.10 * 0.05 ** 0.01) nogaps replace


//DV: participation in protests
logit partprotest gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim if votedref==0, rob
est store M1
logit partprotest gender age_group adjincome  employed language_tri_dum3 language_tri_dum1 ideology educ_3 cat_origins refvictim_close if votedref==0, rob
est store M2
esttab M1 M2 using Table8.tex, b(a2) se(a2) scalars(ll) star(+ 0.10 * 0.05 ** 0.01) nogaps replace

**end






